import axios from '@/libs/api.request.js'

export const getList = data =>{
    return axios.request({
        url:'student/exam/getList',
        method:'post',
        data:data
    });
};

export const getScoreStatus = data =>{
    return axios.request({
        url:`student/exam/getScoreStatus/${data.id}`,
        method:'get',
        data:null
    });
};

export const findExamByRedis = data => {
    return axios.request({
        url:`student/exam/findExamByRedis/${data.id}`,
        method:'post',
        data:data
    });
};

export const saveTempDataToRedis = data => { //学生答卷时，把学生答案临时保存到redis中
    return axios.request({
        method:'post',
        data:data,
        url:`student/exam/saveTempDataToRedis`
    });
};

export const echoTempAnswer = data => { //回显临时数据
    return axios.request({
        url:`student/exam/echoTempAnswer/${data.id}`,
        method:'get',
        data:null
    });
};


export const saveStudentExam = data => {
    return axios.request({
        url:'student/exam/saveStudentExam',
        method:'post',
        data:data
    });
};

export const checkUpperResult = data => { //回显临时数据
    return axios.request({
        url:`student/exam/checkUpperResult/${data.id}`,
        method:'get',
        data:null
    });
};

export const getShowExamStatus = data =>{
    return axios.request({
        url:`student/exam/getShowExamStatus/${data.id}`,
        method:'get',
        data:null
    });
};

export const goBackStudentExamData = data =>{
    return axios.request({
        method:'post',
        data:data,
        url:`student/exam/goBackStudentExamData`
    });
};

export const getExamTypeAndStudentScore = data => {
    return axios.request({
        method:'get',
        data:null,
        url:`student/exam/getExamTypeAndStudentScore/${data.id}`
    });
};

export const updateScoreStatus = data => {
    return axios.request({
        method:'get',
        data:null,
        url:`student/exam/updateScoreStatus/${data.id}`
    });
};